/**
 * @Copyright 
 * @Project inetdisk
 * @CreateTime 2015-10-12 上午11:01:19
 */
package ren.wxyz.inetdisk.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * <p>
 * JDBC方式的抽象类
 * </p>
 * 
 * @Author wxyz
 * @CreateTime 2015-10-12 上午11:01:19 init class
 */
public abstract class JdbcBaseDao {

	@Autowired
	private JdbcTemplate jdbcTemplate;

	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

	public Long getCount(String sql) {
		return Long.valueOf(jdbcTemplate.queryForObject(sql, Integer.class));
	}
}
